<%@ page language="java" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>退货记录定义表管理</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <jsp:include page="../com/header.jsp"></jsp:include>
    <script type="text/javascript" src="../../js/comm/listcomm.js"></script>
    <script type="text/javascript" src="returnShop.js"></script>
    <script type="text/javascript">
        var contentUrl = root + "cms/returnshoprecord/findReturnshoprecordNEStatusPage";
        var editUrl = 'returnshoprecordEdit.jsp?id=';
        var operateUrl = root + 'cms/returnshoprecord/operateReturnshoprecordByIds';
        function getfilter() {
            var _jsonFilter = "{";
            if ($("#search_orderNo").val() && $("#search_orderNo").val().length > 0) {
                _jsonFilter += "'search_EQ_orderNo':'" + $("#search_orderNo").val().replace("'", "\"") + "',";
            }
            if ($("#search_type").val() && $("#search_type").val().length > 0) {
                _jsonFilter += "'search_EQ_type':'" + $("#search_type").val().replace("'", "\"") + "',";
            }
            //退款状态
            if ($("#search_refundStatus").val() && $("#search_refundStatus").val().length > 0) {
                _jsonFilter += "'search_EQ_refundStatus':'" + $("#search_refundStatus").val().replace("'", "\"") + "',";
            }
            if (_jsonFilter != "{") {
                _jsonFilter = _jsonFilter.substring(0, _jsonFilter.length - 1);
            }
            _jsonFilter += "}";
            return _jsonFilter;
        }
    </script>
</head>
<body>

<section>
    <div>
        <div class="col-xs-12">
            <div class="box">
                <form id="search_form" class="form-horizontal">
                    <div class="tabSelect" id="selectHeadId">
                        <br>
                        <div class="form-group  col-md-3 search-form">
                            <label class="col-md-4 control-label controls" for="">订单编号：</label>
                            <div class="col-md-8">
                                <input type="text" placeholder="订单编号" class="form-control input-sm" id="search_orderNo"
                                       name="orderNo"/>
                            </div>
                        </div>
                        <div class="form-group  col-md-3 search-form">
                            <label class="col-md-4 control-label controls">退款类型：</label>
                            <div class="col-md-8">
                                <select class="form-control input-sm" id="search_type" name="type">
                                    <option value="">请选择</option>
                                    <option value="0">退款</option>
                                    <option value="1">退款退货</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group  col-md-3 search-form">
                            <label class="col-md-4 control-label controls">退款状态：</label>
                            <div class="col-md-8">
                                <select class="form-control input-sm" id="search_refundStatus" name="refundStatus">
                                    <option value="">请选择</option>
                                    <option value="80">申请中</option>
                                    <option value="81">退款中</option>
                                    <option value="82">审核拒绝</option>
                                    <option value="83">退款成功</option>
                                    <option value="84">退款失败</option>
                                </select>
                            </div>
                        </div>
                        <input type="button" value="查询" id="search" class="btn btn-primary searchBtn">
                    </div>
                </form>
                <div class="box-body table-responsive" style="clear:both;">
                    <input type="button" value="审核" id="audit_btn" class="btn btn-success">
                </div>
                <div class="box-body table-responsive">
                    <table id="example2" class="table table-bordered table-hover">
                        <thead>
                        <tr>
                            <th width="30"><input type="checkbox" id="_selectAll"/></th>
                            <th width="80">订单编号</th>
                            <th width="50">用户名</th>
                            <th width="50">审核状态</th>
                            <th width="80">退货类型</th>
                            <th width="80">退货原因</th>
                            <th width="50">退货金额(元)</th>
                            <th width="50">退货图片</th>
                            <th width="50">退款方式</th>
                            <th width="50">退货提交时间</th>
                        </tr>
                        </thead>
                        <!-- 表格内容 start -->
                        <tbody id="mycontent"></tbody>
                        <!-- 表格内容 end -->
                    </table>
                    <!-- 分页标签 start -->
                    <div class="row page_big_div" id="displayPage"></div>
                    <!-- 分页标签 end -->
                    <script id="tableContentTmple" type="text/x-jsrender">
								<tr>
									<td><input id="ck_{{:id}}" ckId="{{:id}}" ckStatus="{{:status}}" ckAuditResult="{{:order.refundStatus}}" class="ckSelect" type="checkbox" /></td>
									<td>{{:orderNo}}</td>
									<td>{{:userName}}</td>
									<td>{{if order.refundStatus==80}}申请中{{else order.refundStatus==81}}退款中{{else order.refundStatus==82}}审核拒绝{{else order.refundStatus==83}}退款成功{{else}}退款失败{{/if}}</td>
									<td>{{if type==0}}仅退款{{else type==1}}退货退款{{/if}}</td>
									<td style="vertical-align:middle; text-align:left;" title="{{:reason}}">{{:reason}}</td>
									<td style="vertical-align:middle; text-align:right;">{{:order.goodsTotalPrices}}</td>
									<td id="layer-photos-demo{{:id}}" class="layer-photos-demo">
                                        {{if imgs}}
                                             {{for imgs.split(",")}}
                                                <img {{if #index >= 1}}hidden="hidden"{{/if}}
                                                    layer-src="../../{{:}}"
                                                    layer-pid="{{:id}}"
                                                    src="../../{{:}}"
                                                    alt=""
                                                    layer-index="{{:#parent.parent.id}}"
                                                    height="80" width="80">
                                            {{/for}}
                                        {{else}}

                                        {{/if}}
									</td>
									<td>{{:order.paymentKindStr}}</td>
									<td>{{:createTime}}</td>
								</tr>
                    </script>
                </div>
            </div>
        </div>
</section>
<!-- 审核弹出框 -->
<div class="modal fade" id="sentGoods" tabindex="-1" role="dialog"
     aria-labelledby="myModalLabel" aria-hidden="true">
    <form id="sentvalidateForm" class="form-horizontal">
        <div class="modal-dialog">
            <div class="modal-content"  style="background-color: #fff;height: 400px;width: 518px;">
                <div class="modal-header">
                    <button type="button" class="close back" data-dismiss="modal"
                            aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel_sentGoods">审核内容</h4>
                </div>
                <div class="form-group  col-md-9 search-form" style="width: 400px;">
                    <label class="col-md-4 control-label controls" style="margin-top: 50px;">审核结果：</label>

                    <div class="col-md-8" style="margin-top: 46px;">
                        <select class="form-control input-sm" id="refundStatus" name="refundStatus"
                                style="width: 200px;height: 35px;">
                            <option value="">请选择</option>
                            <option value="81">审核通过</option>
                            <option value="82">审核拒绝</option>
                        </select>
                    </div>
                </div>
                <div class="form-group  col-md-9 search-form" style="width: 400px;margin-top: -25px;">
                    <label class="col-md-4 control-label controls" style="margin-top: 50px;">审核原因：</label>

                    <div class="col-md-8" style="margin-top: 46px;">
                        <textarea style="outline:none;resize:none;" placeholder="请输入审核原因"  data-rule="length[0~]"
                                  rows="5" cols="50" class="form-control input-sm"
                                  id="refundAdvice" name="refundAdvice"></textarea>
                    </div>
                </div>
                <div class="box-header" style="padding:170px 90px 0px 90px;background-color: #fff;width: 500px;">
                    <br>
                    <input type="button" value="确定" id="sent" class="btn btn-success">
                    <button type="button" class="btn btn-primary back" data-dismiss="modal" aria-hidden="true"
                            style="margin-left: 70px;">返回
                    </button>
                </div>
            </div>
        </div>
    </form>
</div>

</body>
</html>